package com.evidencer.java.juint;

import org.junit.Test;

import com.evidencer.java.dao.StudentDao;
import com.evidencer.java.domain.Student;
import com.evidencer.java.exception.StudentNotFoundException;

/**
 * @Title: StudentDaoTest.java
 * @Package com.evidencer.java.juint
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2014/01/13 14:41:08
 * @version V1.0
 */
public class StudentDaoTest {
	
	@Test
	public void addTest(){
		Student student=new Student();
		student.setExamid("1232");
		student.setGrade(89.0);
		student.setLocation("北京");
		student.setName("王五");
		student.setStudentid("1255668");
		
		StudentDao studentDao=new StudentDao();
		studentDao.add(student);
		}
	
	@Test
	public void findTest(){
		StudentDao studentDao=new StudentDao();
		Student stu=studentDao.find("1255668");
		
	}
	
	@Test
	public void deleteTest(){
		StudentDao studentDao=new StudentDao();
		try {
			studentDao.delete("1255668");
		} catch (StudentNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}

